题目传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4031
仍然是裸的矩阵树
#include<iostream> #include<iostream> #include<cstdio> #define LL long long using namespace std; const LL MAXN = 100; const LL MOD = 1000000000; LL G[MAXN][MAXN],n,m,num[MAXN][MAXN],cnt; char pat[MAXN]; inline int Gauss(){ for (LL j=1;j<=n;j++) for (LL i=1;i<=n;i++) G[i][j] = (G[i][j]%MOD + MOD) % MOD; LL ret = 1; for (LL j=1;j<=n;j++) { for (LL k=j+1;k<=n;k++) while (G[j][k]) { LL t = G[j][j] / G[j][k]; for (LL i=1;i<=n;i++) G[i][j] = ((G[i][j] - G[i][k]*t) % MOD + MOD) % MOD; for (LL i=1;i<=n;i++) swap(G[i][j], G[i][k]); ret *= -1; ret = (ret%MOD + MOD) % MOD; } ret = (G[j][j]*ret%MOD + MOD) % MOD; } return ret; } inline void AddEdge(LL u, LL v){ G[u][u]++; G[v][v]++; G[u][v]--; G[v][u]--; } int main(){ scanf("%d%d",&m,&n); for (LL j=1;j<=m;j++) { scanf("%s",pat+1); for (LL i=1;i<=n;i++) if (pat[i] == '.') { num[i][j] = ++cnt; if (num[i-1][j]) AddEdge(num[i][j],num[i-1][j]); if (num[i][j-1]) AddEdge(num[i][j],num[i][j-1]); } } n = cnt-1; printf("%d\n",Gauss()); return 0; }
Hello to all, how is all, I think every one is getting more from this website, and your views
are nice for new people.
I absolutely love your blog and find nearly all of your post’s to be what precisely I’m
looking for. can you offer guest writers to write content for you?
I wouldn’t mind writing a post or elaborating on a lot of
the subjects you write about here. Again, awesome web site!
When I initially commented I seem to have clicked the -Notify
me when new comments are added- checkbox and now whenever a comment is added I
receive 4 emails with the exact same comment. Perhaps there is a means you are able to remove
me from that service? Many thanks!
Fantastic website. Lots of helpful info here.
I’m sending it to some friends ans additionally
sharing in delicious. And certainly, thanks on your effort!
My coder is trying to convince me to move to .net from PHP.
I have always disliked the idea because of the costs. But he’s tryiong none the
less. I’ve been using WordPress on several websites for about a year and am worried about switching to another platform.
I have heard fantastic things about blogengine.net.
Is there a way I can import all my wordpress content into it?
Any help would be really appreciated!
I was more than happy to uncover this great site.
I want to to thank you for ones time just for this wonderful read!!
I definitely loved every bit of it and I have you bookmarked to see new
information in your site.
If you wish for to increase your knowledge simply keep visiting this website and be
updated with the most recent gossip posted here.
Today, while I was at work, my cousin stole my iphone
and tested to see if it can survive a thirty foot drop, just so she
can be a youtube sensation. My apple ipad is now broken and she has 83 views.
I know this is totally off topic but I had to share it with someone!
I’ve been exploring for a bit for any high-quality articles or weblog posts
on this sort of space . Exploring in Yahoo I at last stumbled upon this web site.
Studying this info So i’m happy to express that I’ve an incredibly just right uncanny feeling I found out just what I needed.
I such a lot surely will make sure to don?t overlook this web
site and give it a look regularly.
This is my first time pay a quick visit at here and i am
genuinely impressed to read everthing at alone place.
Howdy just wanted to give you a quick heads up and let you know a few of the pictures aren’t loading correctly.
I’m not sure why but I think its a linking issue. I’ve tried it in two different internet browsers and both show the same outcome.
Excellent way of describing, and nice article to obtain information concerning my presentation topic, which
i am going to deliver in university.
I love it when people come together and share ideas.
Great website, continue the good work!
We’re a group of volunteers and starting a new scheme in our community. Your site offered us with valuable info to work on. You have done a formidable job and our whole community will be grateful to you.
Good replies in return of this matter with real arguments and telling all about that.
Hi there just wanted to give you a brief heads up and let you know a few of the images aren’t loading correctly.
I’m not sure why but I think its a linking issue. I’ve tried it in two different web browsers and both
show the same results.
Awesome post.
Hey just wanted to give you a brief heads up and let you know a few of the images
aren’t loading properly. I’m not sure why but I think its a linking issue.
I’ve tried it in two different browsers and both show the same outcome.
I simply could not depart your web site prior to suggesting that I actually loved
the standard information an individual provide in your
guests? Is going to be back steadily in order to investigate cross-check new posts
Wow! This blog looks just like my old one!
It’s on a totally different topic but it has pretty much the same page layout and design. Excellent choice of colors!
Wow! In the end I got a webpage from where I be capable of truly
get helpful information regarding my study and knowledge.
This website was… how do you say it? Relevant!! Finally I’ve
found something which helped me. Thanks!
It’s really a nice and helpful piece of information. I am happy that you just shared this helpful information with us. Please keep us informed like this. Thank you for sharing.
Thank you for the good writeup. It in fact was a amusement account it. Look advanced to more added agreeable from you! By the way, how could we communicate?
My goal here is to link the wordpress blog entries to a frame in a personal site. So I want only the blog entries to appear, but none of the menu bars or other things associated with wordpress only what was posted. I know wordpress is done in PHP so i was wondering if anybody knew the specifics of the coding and how I would go about doing this.. . Thanks!.